<?php 
	$device=Tools::checkDevice();
	$video=$clip_url;
	$html='';
	if($device!='wap'){
		$html= '<video id="player1" width="100%"  controls="controls" controls>';
					$html.= '<source src="'.$video.'" type="video/mp4" />';
					$html.='</video>';
					if($device!='android' && $device!='android2.1'){
						$html.= '<script type="text/javascript">'.
					  'MediaElement("player1", {success: function(me) {'.
					    'me.play();'.
					    'me.addEventListener("timeupdate", function() {'.
					    //'document.getElementById("time").innerHTML = me.currentTime;'.
						'}, false);'.
						'document.getElementById("pp")["onclick"] = function() {'.
						'if (me.paused){me.play();} else{me.pause();}};'.
					  '}});</script>';
					}
					else{
						
						$html.='<script type="text/javascript">'.
						'function init() {
					      enableVideoClicks();
					    }
					    function enableVideoClicks() {
					      var videos = document.getElementsByTagName("video") || [];
					      for (var i = 0; i < videos.length; i++) {
					        // TODO: use attachEvent in IE
					        videos[i].addEventListener("click", function(videoNode) {
					          return function() {
					            videoNode.play();
					          };
					        }(videos[i]));
					      }
					    }
					    init();
					    </script>';
					}
	}
	else{
		$html='<a class="player_video" href="'.$video.'"><img src="'.Yii::app()->request->baseUrl.'/images/Play_50-1.png"/></a>';
	}
?>
<div class="clip_player"><?php echo $html;?></div>